*Do White In-Group Processes Matter, Too?  White Racial Identity and Support for Black Political Candidates
*Gregory A. Petrow, John Transue and Timothy Vercellotti
*DO file
*Accepted for publication in Political Behavior

*Table 1.  White Racial Identity among Whites and Democratic Presidential Vote Choice in 1984 thru 2000 and 2008 thru 2012: Logistic Regressions \\

*1984 
use "1984anes.dta"

recode V841098 (1=1) (5/9=0), gen (whiteid) //
recode V840318 (8/9=3), gen (repid) //
recode V840369 (0=4) (8/9=4), gen(conid) //
recode V840438 (98=.) (99=.), gen(educ) //
recode V840681 (0=.) (88/99=.), gen(income) //
recode V840688 (0=.) (1=5) (2=4) (4=2) (5=1) (8/9=.), gen(churattend) //
recode V840707 (1=1), gen(female) //
recode V840708 (1=1) (2/9=0), gen(white)
recode V840227 (1=3) (3=2) (5=1) (8=2) (9=.), gen(retroecon) //
recode V840243 (1=3) (3=2) (5=1) (8=2) (9=.), gen(prospecon) //
recode V840429 (0=.), gen(age) //
recode V840009 (3=1) (1/2=0) (4=0), gen(south)

**deep south = sc, ms, fl, al, ga, la, tx, va, ark, tn, and nc
**1, 5, 12, 13, 37, 47, 48, 51
recode V840011 (1=1) (2/4=0) (5=1) (6/11=0) (12/13=1) (14/36=0) (37=1) (38/46=0) (47/48=1) (49/50=0) (51=1) (52/99=0), gen(deepsouth)

**FLIP equality 840204 high = low equality
recode V840204 (5=1) (4=2) (2=4) (1=5) (8/9=3), gen(equal1)
**840206 high = pro equality
recode V840206 (8/9=3), gen(equal2)
**FLIP 840208 high = low equal
recode V840208 (5=1) (4=2) (2=4) (1=5) (8/9=3), gen(equal3)
**FLIP 840251 high = low
recode V840251 (5=1) (4=2) (2=4) (1=5) (8/9=3), gen(equal4)
**FLIP 840253 high = low
recode V840253 (5=1) (4=2) (2=4) (1=5) (8/9=3), gen(equal5)
**840255 high = pro equal
recode V840255 (8/9=3), gen(equal6)
**a=.57
alpha equal1 equal2 equal3 equal4 equal5, gen(equalsc)
corr equalsc reaganvoteallparty
pwcorr equal1 equal2 equal3 equal4 equal5

**govt goods and services //
recode V840373 (7=1) (6=2) (5=3) (3=5) (2=6) (1=7) (0=4) (8/9=4), gen(govtdoless)
recode V840788 (2=1) (1=0) (3/9=.) (0=.), gen(mondalevote2party) //

**clustered on county
logit mondalevote2party whiteid govtdoless equalsc repid conid retroecon prospecon educ income churattend female age deepsouth if white==1, cluster(V840012) 
logit mondalevote2party whiteid if white==1, cluster(V840012) 

*1988 
use "1988anes.dta"
recode v881109 (1=1) (0=0) (5/9=0), gen(whiteid)
recode v880413 (2=1) (1=0), gen(female)
recode v880244 (1=5) (2=4) (4=2) (5=1) (0=.), gen(retroecon)
recode v880247 (1=5) (5=1) (8=3) (9=.), gen(prospecon)
**deep south = sc, ms, fl, al, ga, la, tx, va, ark, tn, and nc
**1, 5, 12, 13, 37, 47, 48, 51, 53
recode fipsstat (1=1) (2/4=0) (5=1) (6/11=0) (12/13=1) (14/36=0) (37=1) (38/46=0) (47/48=1) (49/50=0) (51=1) (52=0) (53=1) (54/99=0), gen(deepsouth)
recode presvote (1=0) (0=1), gen(dukevote2)
recode v880413 (2=1) (1=0), gen(female)
recode v880924 (5=1) (4=2) (2=4) (5=1) (8/9=3) (0=3), gen(equal1)
recode v880925 (8/9=3) (0=3), gen(equal2)
recode v880926 (8/9=3) (0=3), gen(equal3)
recode v880927 (8/9=3) (0=3), gen(equal4)
recode v880928 (5=1) (4=2) (2=4) (5=1) (8/9=3) (8/9=3) (0=3), gen(equal5)
recode v880929 (8/9=3) (0=3), gen(equal6)
**a=.80
alpha equal2 equal3 equal4, gen(equalsc)
corr equalsc dukevote2
recode v880244 (1=5) (2=4) (4=2) (5=1) (0=.), gen(retroecon)
recode v880247 (1=5) (5=1) (8=3) (9=.), gen(prospecon)
recode v880302 (0=4) (8/9=4), gen(govdomore) 
recode v880323 (1=7) (2=6) (3=5) (5=3) (6=2) (7=1) (0=4) (8/9=4), gen(govdomore2) 
alpha govdomore govdomore2, gen(govdomoresc)
corr govdomore govdomore2
corr govdomoresc dukevote2
recode fipsstat (1=1) (2/4=0) (5=1) (6/11=0) (12/13=1) (14/36=0) (37=1) (38/46=0) (47/48=1) (49/50=0) (51=1) (52=0) (53=1) (54/99=0), gen(deepsouth)

recode v880961 (5=1) (4=2) (2=4) (1=5) (0=3) (8/9=3), gen(rr1)
recode v880962 (0=3) (8/9=3), gen(rr2)
recode v880963  (5=1) (4=2) (2=4) (1=5) (0=3) (8/9=3), gen(rr3)
recode v880964  (0=3) (8/9=3), gen(rr4)
*a=.72
alpha rr1 rr2 rr3 rr4, gen(resentsc)
recode v880422 (1=0) (2=1) (3=2) (4=3) (5=4) (6=5) (7=6) (98/99=.), gen(educ2)
recode v880521 (88/99=0), gen(income)
recode v880414 (97/99=0), gen(age)
recode v880274 (9=.) (7/8=3), gen(pid2)
recode v880228 (1=0) (2=1) (3=2) (4=3) (5=4) (6=5) (7=6) (0=3) (7=.), gen(ideolid2)
recode v880530 (9=.) (1=5) (2=4) (4=2) (5=1) (0=1), gen(churattend)

logit dukevote2 whiteid resentsc equalsc govdomoresc educ2 income age pid ideolid2 deepsouth female retroecon prospecon churattend, cluster(centractstate)
logit dukevote2 whiteid, cluster(centractstate)

*1992 
use "1992anes.dta", clear
recode v924201 (2=1) (1=0), gen(female)
recode v923532 (1=5) (2=4) (3=3) (4=2) (5=1) (0=3), gen (retroecon)
recode v923537 (1=1) (3=0) (5=-1) (8=0) (9=0), gen (prospecon)
recode v925609 (2=1) (1=0) (0=.) (3/9=.), gen(clintvote2par)
recode v926126 (8/9=3) (0=.), gen (rr1)
recode v926127 (8/9=3) (0=.), gen (rr2)
recode v926128 (8/9=3) (0=.), gen (rr3)
recode v926129 (8/9=3) (0=.), gen (rr4)
alpha rr1 rr2 rr3 rr4, gen(resentsc_merge)
recode v926024 (8/9=3) (0=.), gen(equal1)
recode v926025 (8/9=3) (0=.), gen(equal2)
recode v926026 (8/9=3) (0=.), gen(equal3)
recode v926027 (8/9=3) (0=.), gen(equal4)
recode v926028 (8/9=3) (0=.), gen(equal5)
recode v926029 (8/9=3) (0=.), gen(equal6)
alpha equal1 equal5 equal6 equal2 equal3 equal4, gen(equalsc)
**the classic active v pass government
recode v925729 (1=1) (2=-1) (3/9=0), gen(lessgov1)
recode v925730 (2=1) (1=-1) (3/9=0), gen(lessgov2)
recode v925731 (1=1) (2=-1) (3/9=0), gen(lessgov3)
**a=.72
alpha lessgov1 lessgov2 lessgov3, gen(lessgovsc)
**deep south = sc, ms, fl, al, ga, la, tx, va, ark, tn, and nc
recode v923017 (1/39=0) (40=1) (41=1) (42=1) (43=1) (44=1) (45=1) (46=0) (47=1) (48=0) (49=1) (50/53=0) (54=1) (55/99=0), gen(deepsouth) 
recode v926215 (1=1) (9=.) (0=.) (5=0), gen(whiteid)
recode v923908 (1=0) (2=1) (3=2) (4=3) (5=4) (6=5) (7=6) (98/99=.) (0=.), gen(educ)
recode v924105 (66/99=.), gen(income)
recode v923903 (0=.), gen(age)
recode v923509 (9=.), gen(ideolid)
recode v923634(9=.), gen(pid)
recode v923828 (5/9=1) (0=1) (1=5) (2=4) (4=2), gen(churattend)

logit clintvote2par whiteid resentsc_merge retroecon prospecon equalsc lessgovsc educ income age ideolid pid churattend deepsouth female [iweight=v923008], cluster(centractid)
logit clintvote2par whiteid  [iweight=v923004], cluster(centractid)

*1996 \\
use "1996anes.dta", clear
recode v960365 (1=0) (2=1) (3=2) (4=3) (5=4) (6=5) (7=6), gen(ideolid)
recode v960420 (99=.), gen(pid)
recode v960067 (1=1), gen(white)
recode v961308 (1=1)(5=0), gen(whiteid)
recode v960610 (1=0) (2=1) (3=2) (4=3) (5=4) (6=5) (7=6), gen(educ)
recode v960702 (25=.), gen(income)
recode v960605 (94=.), gen(age)
recode v960578 (1=5) (2=4) (3=3) (4=2) (5=1) (0=1) (8/9=.) , gen (churattend)
recode v960386 (1=5) (2=4) (3=3) (4=2) (5=1) (0=3), gen (retroecon)
recode v960388 (1=5) (2=4) (3=3) (4=2) (5=1) (0=3), gen (prospecon)
recode dolevote (0=1) (1=0), gen (clintvote2par)
recode v960066 (2=1) (1=0), gen(female)
recode v961082 (1=1) (2=0) (3/7=0), gen(clintvote2par)
recode v961144 (1=1) (2=-1) (9=0), gen(lessgov1)
recode v961145 (2=1) (1=-1) (9=0), gen(lessgov2)
recode v961146 (1=1) (2=-1) (9=0), gen(lessgov3)
**a=.75
alpha lessgov1 lessgov2 lessgov3, gen(lessgovsc)
recode v961229 (1=5) (2=4) (4=2) (5=1) (8/9=3), gen(equal1)
recode v961230 (8/9=3), gen(equal2)
recode v961231 (1=5) (2=4) (4=2) (5=1) (8/9=3), gen(equal3)
recode v961232 (8/9=3), gen(equal4)
recode v961233 (8/9=3), gen(equal5)
recode v961234 (1=5) (2=4) (4=2) (5=1) (8/9=3), gen(equal6)
**a=.71
alpha equal1 equal2 equal3 equal4 equal5 equal6, gen(equalsc)
recode v960109 (1/39=0) (40=1) (41=1) (42=1) (43=1) (44=1) (45=1) (46=0) (47=1) (48=0) (49=1) (50/53=0) (54=1) (55/99=0), gen(deepsouth) 
**policy and racial attitudes:  none
recode v960386 (1=5) (2=4) (3=3) (4=2) (5=1) (0=3), gen (retroecon)
recode v960388 (1=5) (2=4) (3=3) (4=2) (5=1) (0=3), gen (prospecon)
logit clintvote2par whiteid ideolid pid lessgovsc equalsc prospecon retroecon educ income age deepsouth churattend female [iweight=v960003], cluster(v960110)
logit clintvote2par whiteid [iweight=v960003], cluster(v960110)

*2000 
use "2000anes.dta"
recode V001249 (3=1) (1=0) (4/7=.) (0=.) (8/9=.) (2=0), gen (bushvote2party)
recode bushvote2party (1=0) (0=1), gen(demvote2party)
recode V001029 (2=1) (1=0), gen(female)
**educ
recode V000913 (8=.) (9=.), gen (educ)
**income
recode V000994 (98/99=.) (00=.), gen (income)
**white
recode V001006a (50=1) (10/40=0) (60/100=0), gen (white)
**age
recode V000908 (0=.), gen (age)
**ideol
recode V001368 (8=4) (9=4) (0=4), gen (conid)
**pid
recode V000523 (7/9=3), gen (repid)
**whiteid
**FTF
recode V001540 (1=1) (5=-1) (0=0), gen (whiteidftf)
recode V001541 (1=1) (5=-1) (0=0) (8/9=-1), gen (whiteidphone)
gen whiteidcombo = whiteidftf+whiteidphone
tab whiteidcombo
**I could recode this and drop the "0"'s
recode whiteidcombo (0=.) (-1=0), gen (whiteid)
**prospecon
recode V000499 (1=5) (2=4) (3=3) (4=2) (5=1) (8=3) (9=3) (0=3), gen (prospecon)
**retroecon
recode V000491 (1=5) (2=4) (3=3) (4=2) (5=1) (8=3) (9=3) (0=3), gen (retroecon)
**south
recode V000092 (3=1) (1/2=0) (4=0), gen (south)
**churattend
recode V000879 (1=5) (2=4) (3=3) (4=2) (5=1) (0=1) (8/9=.), gen (churattend)
recode bushvote2party (1=0) (0=1), gen(demvote2party)
recode V001029 (2=1) (1=0), gen(female)

**race resent
recode V001508 (1=5) (2=4) (4=2) (5=1) (8=3) (9=3), gen(rr1)
recode V001509 (1=5) (2=4) (4=2) (5=1) (8=3) (9=3), gen(rr2)
recode V001510 (8=3) (9=3), gen(rr3)
recode V001511 (8=3) (9=3), gen(rr4)
pwcorr rr1 rr2 rr3 rr4
**a=.68
alpha rr1 rr2 rr3 rr4, gen(resentsc)

recode V001420 (1=1) (2=-1) (8/9=0), gen(lessgov1)
recode V001421 (2=1) (1=-1) (8/9=0), gen(lessgov2)
recode V001422 (1=1) (2=-1) (8/9=0), gen(lessgov3)
pwcorr lessgov1 lessgov2 lessgov3
**a=.74
alpha lessgov1 lessgov2 lessgov3, gen(lessgovsc)

recode V001521 (1=5) (2=4) (4=2) (5=1) (8/9=3), gen(equal1)
recode V001522 (8=3) (9=3), gen(equal2)
recode V001523 (1=5) (2=4) (4=2) (5=1) (8/9=3), gen(equal3)
recode V001524 (8=3) (9=3), gen(equal4)
recode V001525 (8=3) (9=3), gen(equal5)
recode V001526 (1=5) (2=4) (4=2) (5=1) (8/9=3), gen(equal6)
pwcorr equal1 equal2 equal3 equal4 equal5 equal6
**a=.91
alpha equal1 equal2 equal3 equal4 equal5 equal6, gen(equalsc)
recode V000080 (1=1) (2/4=0) (5=1) (6/11=0) (12/13=1) (14/36=0) (37=1) (38/46=0) (47/48=1) (49/50=0) (51=1) (52=0) (53=1) (54/99=0), gen(deepsouth)

logit demvote2party whiteid resentsc lessgovsc equalsc repid conid  retroecon prospecon income age educ deepsouth churattend female [iweight=V000002] if white==1, cluster(V000082)
logit demvote2party whiteid [iweight=V000002] if white==1, cluster(V000082)

*2008 
use "2008cces.dta", clear
recode cc410 (2=1) (1=0) (3/9=.), gen(obamavote2party)
recode cc302 (1=5) (2=4) (4=2) (5=1) (6/99=3), gen(retroecon)
recode cc304a (1=3) (3=1), gen (prospecon1)
recode cc304b (1=3) (3=1), gen (prospecon2)
corr prospecon1 prospecon2
**a=.84
alpha prospecon1 prospecon2, gen(prospeconsc)
recode dff3112 (1=4) (2=3) (3=2) (4=1) (5/99=.), gen(whid3)
recode demid (1=7) (2=6) (3=5) (5=3) (6=2) (7=1), gen(repid)
recode libid (1=5) (2=4) (4=2) (5=1), gen (conid)
recode cc304 1=1 2=0 3=0 4=0 5=0 8=0 9=0, gen (iraqbad)
recode dff396 1=5 2=4 8=3 3=2 4=1, gen (rr1)
recode dff3102 1=5 2=4 8=3 3=2 4=1, gen (rr2)
recode dff3100 4=5 3=4 5=3 8=3 2=2 1=1 9=., gen (rr3)
recode dff3101 4=5 3=4 5=3 8=3 2=2 1=1 9=., gen (rr4)
recode dff395 1=5 2=4 5=3 8=3 3=2 4=1 9=., gen (rr5)
recode dff3118b 1=5 2=4 5=3 8=3 3=2 4=1 9=., gen (rr5v2)
recode dff3119b 4=5 3=4 5=3 8=3 2=2 1=1 9=., gen (rr3v2)
recode dff3120b 1=5 2=4 5=3 8=3 3=2 4=1 9=., gen (rr4v2)
alpha rr1 rr2 rr3 rr4 rr5, gen(resentsc)
recode cc422 1=1 2/3=0, gen (procarbtax)
recode v208 2=1 1=0, gen (female)
recode v213 8=. 9=., gen (educ)
recode v217 6=1 5=2 4=3 3=4 2=5 1=6 7=1 8=1, gen (churchattend)
gen age = 2008-v207
recode v246 1=1 2=2 3=3 4=4 5=5 6=6 7=7 8=8 9=9 10=10 15=., gen (faminc)
recode v251b (1=1) (12/13=1) (22=1) (28=1) (45=1) (48=1) (2/11=0) (14/21=0) (23/27=0) (29/44=0) (46/47=0) (49/99=0), gen (deepsouth)
**impute family income
recode v246 1=1 2=2 3=3 4=4 5=5 6=6 7=7 8=8 9=9 10=10 15=., gen (faminc)
tab faminc
regress faminc  female unemployed black married educ milfam unionmem homeown churchattend bushdisapp obamavote age 
*then solve for the missing values using the coefficients from the regression

logit obamavote2party whid3 resentsc iraqbad procarbtax retroecon prospeconsc repid conid female educ churchattend age famincimp deepsouth [pweight=v201], cluster(v264)
*Figure E1
prvalue, x(whid3=1) save
prvalue, x(whid3=2) diff
prvalue, x(whid3=3) diff
prvalue, x(whid3=4) diff

*2012 
use "2012anes", clear
recode libcpre_self (1=1) (2=2) (3=3) (4=4) (5=5) (6=6) (7=7) (-2=4) (-8=4) (-9=4), gen(conid7pt)
recode pid_x (1=1) (2=2) (3=3) (4=4) (5=5) (6=6) (7=7) (-2=.), gen(repid7pt)
recode dem_marital (1=1) (2=1) (3=0) (4=0) (5=0) (6=0) (-9=0), gen(married)
recode dem_edugroup (1=1) (2=2) (3=3) (4=4) (5=5) (-2=.) (-9=.), gen(educ)
recode gender_respondent (1=1) (2=2) (-1=.), gen(female)
recode ident_whiteid (1=5) (2=4) (3=3) (4=2) (5=1) (-1=.) (-2=.) (-6=.) (-7=.) (-9=.), gen(whiteid)
recode health_2010hcr (1=1) (3=2) (2=3) (-8=2) (-9=2), gen(healthcareopp)
recode presvote2012_x (1=1) (2=0) (5=.) (-2=.) (-6=.) (-9=.), gen(obama2party)
recode relig_churchoft (1=5) (2=4) (3=3) (4=2) (5=1) (-1=.) (-9=3), gen(churchattend)
recode sample_stfips (1=1) (2=0) (4=0) (5=0) (6=0) (8=0) (9=0) (10=0) (11=0) (12=1) (13=1) (15=0) (16=0) (17=0) (18=0) (19=0) (20=0) (21=0) (22=1) (23=0) (24=0) (25=0) (26=0) (27=0) (28=1) (29=0) (30=0) (31=0) (32=0) (33=0) (34=0) (35=0) (36=0) (37=0) (38=0) (39=0) (40=0) (41=0) (42=0) (44=0) (45=1) (46=0) (47=0) (48=1) (49=0) (50=0) (51=0) (53=0) (54=0) (55=0) (56=0), gen(deepsouth)
recode dem_raceeth (1=1) (2=0) (3=0) (4=0) (-8=0) (-9=0), gen(white)
recode resent_workway (1=5) (2=4) (3=3) (4=2) (5=1) (-6=.) (-7=.) (-8=3) (-9=3), gen(blacksnofavors)
recode resent_slavery (1=1) (2=2) (3=3) (4=4) (5=5) (-6=.) (-7=.) (-8=3) (-9=3), gen(pastslaverynohrd)
recode resent_deserve (1=1) (2=2) (3=3) (4=4) (5=5) (-6=.) (-7=.) (-8=3) (-9=3) (-1=.), gen(blknotlessdeserve)
recode resent_try (1=1) (2=2) (3=3) (4=4)(5=5) (-6=.) (-7=.) (-8=3) (-9=3), gen(blktryhrd)
alpha blacksnofavors blknotlessdeserve pastslaverynohrd blktryhrd, gen(resentsc)
recode mode (1=1) (2=0), gen(ftf)
recode econ_ecnow (1=5) (2=4) (4=2) (5=1) (-8=3) (-9=.), gen (econcurrgood)
recode econ_ecpast_x (1=5) (2=4) (4=2) (5=1) (-8=3) (-9=.), gen (econpastyrbtr)
recode econ_ecnext_x (1=5) (2=4) (4=2) (5=1) (-8=3) (-9=.), gen (econnxtyrbtr)
recode egal_equal (1=5) (2=4) (4=2) (5=1) (-6/-7=.) (-8=3) (-9=3), gen (egal1)
recode egal_toofar (-6/-7=.) (-8=3) (-9=3), gen (egal2)
recode egal_bigprob  (1=5) (2=4) (4=2) (5=1) (-6/-7=.) (-8=3) (-9=3), gen (egal3)
recode egal_worryless  (-6/-7=.) (-8=3) (-9=3), gen (egal4)
recode egal_notbigprob  (-6/-7=.) (-8=3) (-9=3), gen (egal5)
recode egal_fewerprobs  (1=5) (2=4) (4=2) (5=1) (-6/-7=.) (-8=3) (-9=3), gen (egal6)
corr egal1 egal2 egal3 egal4 egal5 egal6
**a=.98
alpha egal1 egal2 egal3 egal4 egal5 egal6, gen(egalitsc)
recode govrole_big (1=1) (2=0) (-6=.) (-7=.) (-8=0) (-9=0), gen (limitgov1)
recode govrole_market (2=1) (1=0)  (-6=.) (-7=.) (-8=0) (-9=0), gen (limitgov2)
recode govrole_lessmore  (1=1) (2=0) (-6=.) (-7=.) (-8=0) (-9=0), gen (limitgov3)
corr limitgov1 limitgov2 limitgov3
**a=.77
alpha limitgov1 limitgov2 limitgov3, gen (limitgovsc)
recode dem_agegrp_iwdate (15=.), gen(age)
recode incgroup_prepost (-6=.) (-8=13) (-9=13), gen(income)

logit obama2party whiteid resentsc healthcareopp egalitsc limitgovsc econpastyrbtr econnxtyrbtr educ female ftf age income churchattend deepsouth conid7pt repid7pt if white==1 [iweight=weight_full], cluster (sample_district)
*Figure E2
prvalue, x(whiteid=1) save
prvalue, x(whiteid=2) diff
prvalue, x(whiteid=3) diff
prvalue, x(whiteid=4) diff
prvalue, x(whiteid=5) diff

logit obama2party whiteid if white==1 [iweight=weight_full], cluster (sample_district)

*Table 2:  White Racial Identity among Whites, Democratic Vote Choice and Candidate Preference for Massachusetts Governor in 2010 among Whites, Logistic Regression \\

use "2010mssdata.dta"

recode whid (1=4) (2=3) (3=2) (4=1) (5=1) (9=1), gen (whid4pt)
recode q4 (1=1) (2/9=0), gen(marightdir)
*pid; merge in 2010 mss mergevars.xlsx
recode q42 (1=2) (2=-2) (3/9=0), gen(pidmain2)
recode q42a (1=1) (2=-1) (3/9=0), gen(pidindlean2)

recode gchoi1 (1=1) (2/9=0), gen(patrickvote1)

recode q2 (2=1) (1=0), gen(female)
recode q12 (9=0), gen(educ)
recode q13 (9=0), gen(age)
recode q16 (4=1) (1/3=0) (9=0), gen(inc100more)

logit patrickvote1 whid4pt pid marightdir inc100more age educ female [iweight=sampwt], cluster(colist2)
*Figure E3
quietly prvalue, x(whid4pt=1) save
prvalue, x(whid4pt=2) diff
quietly prvalue, x(whid4pt=1) save
prvalue, x(whid4pt=3) diff
quietly prvalue, x(whid4pt=1) save
prvalue, x(whid4pt=4) diff
logit patrickvote1 whid4pt [iweight=sampwt], cluster(colist2)

logit patrickvotepost whid4pt pid marightdir inc100more age educ female [iweight=sampwt], cluster(colist2)
*Figure E3
quietly prvalue, x(whid4pt=1) save
prvalue, x(whid4pt=2) diff
quietly prvalue, x(whid4pt=1) save
prvalue, x(whid4pt=3) diff
quietly prvalue, x(whid4pt=1) save
prvalue, x(whid4pt=4) diff

logit patrickvotepost whid4pt [iweight=sampwt], cluster(colist2)

*Table 3:  White Racial Identity among Whites and 2010 U.S. Congress Candidate Preference among Whites, Logistic Regression \\
use "2010anes.dta", clear
recode dercands (1=1) (2=0) (3=.) (4/9=.) (-7/-1=.), gen(demsenvote2par)
recode whiteid (3=0) (1=-1) (2=-.5) (4=.5) (5=1), gen (whiteid0)
gen whidblsencand0 = whiteid0*blsencand2010
logit demsenvote2par whidblsencand0 whiteid0 blsencand2010 resent partyid ideol derecon1 stim rollcall obamaap churattend c1_ppage c1_ppe_1 c1_ppgen c1_ppinc deepsouth [pweight=c1_sampw], cluster(c1_state)
*Figure 2
**white id among black candidates
quietly prvalue, x(whidblsencand0=-1 whiteid0=-1 blsencand2010=1) 
prvalue, x(whidblsencand0=-.5 whiteid0=-.5 blsencand2010=1) 
prvalue, x(whidblsencand0=0 whiteid0=0 blsencand2010=1) 
prvalue, x(whidblsencand0=.5 whiteid0=.5 blsencand2010=1) 
prvalue, x(whidblsencand0=1 whiteid0=1 blsencand2010=1) 
**white id among non-black candidates
quietly prvalue, x(whidblsencand0=0 whiteid0=-1 blsencand2010=0) save
prvalue, x(whidblsencand0=0 whiteid0=-.5 blsencand2010=0) diff
prvalue, x(whidblsencand0=0 whiteid0=0 blsencand2010=0) diff
prvalue, x(whidblsencand0=0 whiteid0=.5 blsencand2010=0) diff
prvalue, x(whidblsencand0=0 whiteid0=1 blsencand2010=0) diff
logit demsenvote2par whidblsencand0 whiteid0 blsencand2010 [pweight=c1_sampw], cluster(c1_state)

recode dercandh (1=1) (2=0) (3=.) (4/9=.) (-7/-1=.), gen(demhousevote2par)
gen whiteid0bmocdem = whiteid0*bmocdem2011
logit demhousevote2par whiteid0bmocdem whiteid0 bmocdem2011 resent obamaap partyid ideol derecon1  rollcall stim deepsouth c1_ppage c1_ppe_1 c1_ppgen c1_ppinc churattend [pweight=c1_sampw], cluster(c1_xcd)
*Figure 3
**impact of white id with black candidate
prvalue, x(whiteid0bmocdem=-1 whiteid0=-1 bmocdem2011=1) 
prvalue, x(whiteid0bmocdem=-.5 whiteid0=-.5 bmocdem2011=1) 
prvalue, x(whiteid0bmocdem=0 whiteid0=0 bmocdem2011=1) 
prvalue, x(whiteid0bmocdem=.5 whiteid0=.5 bmocdem2011=1) 
prvalue, x(whiteid0bmocdem=1 whiteid0=1 bmocdem2011=1) 
**impact of white id without black candidate
prvalue, x(whiteid0bmocdem=0 whiteid0=-1 bmocdem2011=0) save
prvalue, x(whiteid0bmocdem=0 whiteid0=-.5 bmocdem2011=0) diff
prvalue, x(whiteid0bmocdem=0 whiteid0=0 bmocdem2011=0) diff
prvalue, x(whiteid0bmocdem=0 whiteid0=.5 bmocdem2011=0) diff
prvalue, x(whiteid0bmocdem=0 whiteid0=1 bmocdem2011=0) diff
logit demhousevote2par whiteid0bmocdem whiteid0 bmocdem2011 [pweight=c1_sampw], cluster(c1_xcd)


*Table 4.  White Racial Identity among Whites and Presidential Approval in 1984 thru 2000; 2008 thru 2012: OLS \\
*1984 
use "1984anes.dta"

recode V841098 (1=1) (5/9=0), gen (whiteid)
recode V840259 (1=5) (2=4) (4=2) (5=1) (8=3) (0=.) (9=.), gen(presapp)
recode V840318 (8/9=3), gen (repid)
recode V840369 (0=4) (8/9=4), gen(conid)
recode V840438 (98=.) (99=.), gen(educ)
recode V840457 (1=1) (2/8=0) (9=.), gen(working)
recode V840676 (1=1) (5=0) (8=0) (9=.), gen(unionhh)
recode V840681 (0=.) (88/99=.), gen(income)
recode V840688 (0=.) (1=5) (2=4) (4=2) (5=1) (8/9=.), gen(churattend)
recode V840707 (1=1), gen(female)
recode V840708 (1=1) (2/9=0), gen(white)
recode V840227 (1=3) (3=2) (5=1) (8=2) (9=.), gen(retroecon)
recode V840243 (1=3) (3=2) (5=1) (8=2) (9=.), gen(prospecon)
recode V840429 (0=.), gen(age)
**deep south = sc, ms, fl, al, ga, la, tx, va, ark, tn, and nc
**1, 5, 12, 13, 37, 47, 48, 51
recode V840011 (1=1) (2/4=0) (5=1) (6/11=0) (12/13=1) (14/36=0) (37=1) (38/46=0) (47/48=1) (49/50=0) (51=1) (52/99=0), gen(deepsouth)
**FLIP equality 840204 high = low equality
recode V840204 (5=1) (4=2) (2=4) (1=5) (8/9=3), gen(equal1)
**840206 high = pro equality
recode V840206 (8/9=3), gen(equal2)
**FLIP 840208 high = low equal
recode V840208 (5=1) (4=2) (2=4) (1=5) (8/9=3), gen(equal3)
**FLIP 840251 high = low
recode V840251 (5=1) (4=2) (2=4) (1=5) (8/9=3), gen(equal4)
**FLIP 840253 high = low
recode V840253 (5=1) (4=2) (2=4) (1=5) (8/9=3), gen(equal5)
**840255 high = pro equal
recode V840255 (8/9=3), gen(equal6)
**a=.57
alpha equal1 equal2 equal3 equal4 equal5, gen(equalsc)
corr equalsc reaganvoteallparty
pwcorr equal1 equal2 equal3 equal4 equal5

**govt goods and services 
recode V840373 (7=1) (6=2) (5=3) (3=5) (2=6) (1=7) (0=4) (8/9=4), gen(govtdoless)
recode V840414 (0=4) (8/9=4), gen(govtdoless2)
alpha govtdoless govtdoless2
corr govtdoless govtdoless2
**use only govtdoless
regress presapp whiteid govtdoless equalsc repid conid retroecon prospecon educ income churattend female age deepsouth if white==1, cluster(V840012)
regress presapp whiteid if white==1, cluster(V840012)


*1988 
use "1988anes.dta"
recode v881109 (1=1) (0=0) (5/9=0), gen(whiteid)
recode v880413 (2=1) (1=0), gen(female)
recode v880244 (1=5) (2=4) (4=2) (5=1) (0=.), gen(retroecon)
recode v880247 (1=5) (5=1) (8=3) (9=.), gen(prospecon)
**deep south = sc, ms, fl, al, ga, la, tx, va, ark, tn, and nc
**1, 5, 12, 13, 37, 47, 48, 51, 53
recode fipsstat (1=1) (2/4=0) (5=1) (6/11=0) (12/13=1) (14/36=0) (37=1) (38/46=0) (47/48=1) (49/50=0) (51=1) (52=0) (53=1) (54/99=0), gen(deepsouth)
recode presvote (1=0) (0=1), gen(dukevote2)
recode v880413 (2=1) (1=0), gen(female)
recode v880924 (5=1) (4=2) (2=4) (5=1) (8/9=3) (0=3), gen(equal1)
recode v880925 (8/9=3) (0=3), gen(equal2)
recode v880926 (8/9=3) (0=3), gen(equal3)
recode v880927 (8/9=3) (0=3), gen(equal4)
recode v880928 (5=1) (4=2) (2=4) (5=1) (8/9=3) (8/9=3) (0=3), gen(equal5)
recode v880929 (8/9=3) (0=3), gen(equal6)
**a=.80
alpha equal2 equal3 equal4, gen(equalsc)
corr equalsc dukevote2
recode v880244 (1=5) (2=4) (4=2) (5=1) (0=.), gen(retroecon)
recode v880247 (1=5) (5=1) (8=3) (9=.), gen(prospecon)
recode v880302 (0=4) (8/9=4), gen(govdomore) 
recode v880323 (1=7) (2=6) (3=5) (5=3) (6=2) (7=1) (0=4) (8/9=4), gen(govdomore2) 
alpha govdomore govdomore2, gen(govdomoresc)
corr govdomore govdomore2
corr govdomoresc dukevote2
recode fipsstat (1=1) (2/4=0) (5=1) (6/11=0) (12/13=1) (14/36=0) (37=1) (38/46=0) (47/48=1) (49/50=0) (51=1) (52=0) (53=1) (54/99=0), gen(deepsouth)

recode v880961 (5=1) (4=2) (2=4) (1=5) (0=3) (8/9=3), gen(rr1)
recode v880962 (0=3) (8/9=3), gen(rr2)
recode v880963  (5=1) (4=2) (2=4) (1=5) (0=3) (8/9=3), gen(rr3)
recode v880964  (0=3) (8/9=3), gen(rr4)
*a=.72
alpha rr1 rr2 rr3 rr4, gen(resentsc)
recode v880422 (1=0) (2=1) (3=2) (4=3) (5=4) (6=5) (7=6) (98/99=.), gen(educ2)
recode v880521 (88/99=0), gen(income)
recode v880414 (97/99=0), gen(age)
recode v880274 (9=.) (7/8=3), gen(pid2)
recode v880228 (1=0) (2=1) (3=2) (4=3) (5=4) (6=5) (7=6) (0=3) (7=.), gen(ideolid2)
recode v880530 (9=.) (1=5) (2=4) (4=2) (5=1) (0=1), gen(churattend)
recode v880141 (1=5) (2=4) (4=2) (5=1) (0=3) (8/9=3), gen(presapp2)

regress presapp2 whiteid resentsc equalsc govdomoresc educ2 income age pid ideolid2 deepsouth female retroecon prospecon churattend, cluster(centractstate)
regress presapp2 whiteid, cluster(centractstate)

use "F:\ANESdiss\nes1988\stata data\1988fullwhitesonly.dta", clear

*1992 
use "1992anes.dta", clear
use "nes1992_edited2.dta", clear
recode v924201 (2=1) (1=0), gen(female)
recode v923532 (1=5) (2=4) (3=3) (4=2) (5=1) (0=3), gen (retroecon)
recode v923537 (1=1) (3=0) (5=-1) (8=0) (9=0), gen (prospecon)
recode v926126 (8/9=3) (0=.), gen (rr1)
recode v926127 (8/9=3) (0=.), gen (rr2)
recode v926128 (8/9=3) (0=.), gen (rr3)
recode v926129 (8/9=3) (0=.), gen (rr4)
alpha rr1 rr2 rr3 rr4, gen(resentsc_merge)
recode v926024 (8/9=3) (0=.), gen(equal1)
recode v926025 (8/9=3) (0=.), gen(equal2)
recode v926026 (8/9=3) (0=.), gen(equal3)
recode v926027 (8/9=3) (0=.), gen(equal4)
recode v926028 (8/9=3) (0=.), gen(equal5)
recode v926029 (8/9=3) (0=.), gen(equal6)
alpha equal1 equal5 equal6 equal2 equal3 equal4, gen(equalsc)
**the classic active v pass government
recode v925729 (1=1) (2=-1) (3/9=0), gen(lessgov1)
recode v925730 (2=1) (1=-1) (3/9=0), gen(lessgov2)
recode v925731 (1=1) (2=-1) (3/9=0), gen(lessgov3)
**a=.72
alpha lessgov1 lessgov2 lessgov3, gen(lessgovsc)
**deep south = sc, ms, fl, al, ga, la, tx, va, ark, tn, and nc
recode v923017 (1/39=0) (40=1) (41=1) (42=1) (43=1) (44=1) (45=1) (46=0) (47=1) (48=0) (49=1) (50/53=0) (54=1) (55/99=0), gen(deepsouth) 
recode v926215 (1=1) (9=.) (0=.) (5=0), gen(whiteid)
recode v923908 (1=0) (2=1) (3=2) (4=3) (5=4) (6=5) (7=6) (98/99=.) (0=.), gen(educ)
recode v924105 (66/99=.), gen(income)
recode v923903 (0=.), gen(age)
recode v923509 (9=.), gen(ideolid)
recode v923634(9=.), gen(pid)
recode v923828 (5/9=1) (0=1) (1=5) (2=4) (4=2), gen(churattend)
recode v923320 (1=5) (2=4) (4=2) (5=1) (0=.) (8/9=.), gen(presapp)

regress presapp whiteid resentsc_merge retroecon prospecon equalsc lessgovsc educ income age ideolid pid churattend south female [aweight=v923008], cluster(centractid)
regress presapp whiteid [aweight=v923008], cluster(centractid)

*1996 
use "1996anes.dta", clear
recode v960296 (1=5) (2=4) (4=2) (5=1), gen(presapp)
recode v960365 (1=0) (2=1) (3=2) (4=3) (5=4) (6=5) (7=6), gen(ideolid)
recode v960420 (99=.), gen(pid)
recode v960067 (1=1), gen(white)
recode v961308 (1=1)(5=0), gen(whiteid)
recode v960610 (1=0) (2=1) (3=2) (4=3) (5=4) (6=5) (7=6), gen(educ)
recode v960702 (25=.), gen(income)
recode v960605 (94=.), gen(age)
recode v960578 (1=5) (2=4) (3=3) (4=2) (5=1) (0=1) (8/9=.) , gen (churattend)
recode v960386 (1=5) (2=4) (3=3) (4=2) (5=1) (0=3), gen (retroecon)
recode v960388 (1=5) (2=4) (3=3) (4=2) (5=1) (0=3), gen (prospecon)
recode dolevote (0=1) (1=0), gen (clintvote2par)
recode v960066 (2=1) (1=0), gen(female)
recode v961144 (1=1) (2=-1) (9=0), gen(lessgov1)
recode v961145 (2=1) (1=-1) (9=0), gen(lessgov2)
recode v961146 (1=1) (2=-1) (9=0), gen(lessgov3)
**a=.75
alpha lessgov1 lessgov2 lessgov3, gen(lessgovsc)

recode v961229 (1=5) (2=4) (4=2) (5=1) (8/9=3), gen(equal1)
recode v961230 (8/9=3), gen(equal2)
recode v961231 (1=5) (2=4) (4=2) (5=1) (8/9=3), gen(equal3)
recode v961232 (8/9=3), gen(equal4)
recode v961233 (8/9=3), gen(equal5)
recode v961234 (1=5) (2=4) (4=2) (5=1) (8/9=3), gen(equal6)
**a=.71
alpha equal1 equal2 equal3 equal4 equal5 equal6, gen(equalsc)
recode v960109 (1/39=0) (40=1) (41=1) (42=1) (43=1) (44=1) (45=1) (46=0) (47=1) (48=0) (49=1) (50/53=0) (54=1) (55/99=0), gen(deepsouth) 
**policy and racial attitudes:  none
recode v960386 (1=5) (2=4) (3=3) (4=2) (5=1) (0=3), gen (retroecon)
recode v960388 (1=5) (2=4) (3=3) (4=2) (5=1) (0=3), gen (prospecon)
regress presapp whiteid ideolid pid lessgovsc equalsc prospecon retroecon educ income age deepsouth churattend female [aweight=v960003], cluster(v960110)
regress presapp whiteid  [aweight=v960003], cluster(v960110)

*2000 
use "2000anes.dta"
**educ
recode V000913 (8=.) (9=.), gen (educ)
**presapp (Clinton)
recode V000341 (1=1) (2=.75) (4=.25) (5=0) (8=.5) (9=.5) (0=.), gen (presapp)
**income
recode V000994 (98/99=.) (00=.), gen (income)
**white
recode V001006a (50=1) (10/40=0) (60/100=0), gen (white)
**age
recode V000908 (0=.), gen (age)
**ideol
recode V001368 (8=4) (9=4) (0=4), gen (conid)
**pid
recode V000523 (7/9=3), gen (repid)
**whiteid
recode whiteidcombo (0=.) (-1=0), gen (whiteid)
**prospecon
recode V000499 (1=5) (2=4) (3=3) (4=2) (5=1) (8=3) (9=3) (0=3), gen (prospecon)
**retroecon
recode V000491 (1=5) (2=4) (3=3) (4=2) (5=1) (8=3) (9=3) (0=3), gen (retroecon)
**south
recode V000092 (3=1) (1/2=0) (4=0), gen (south)
**churattend
recode V000879 (1=5) (2=4) (3=3) (4=2) (5=1) (0=1) (8/9=.), gen (churattend)
recode bushvote2party (1=0) (0=1), gen(demvote2party)
recode V001029 (2=1) (1=0), gen(female)

**race resent
recode V001508 (1=5) (2=4) (4=2) (5=1) (8=3) (9=3), gen(rr1)
recode V001509 (1=5) (2=4) (4=2) (5=1) (8=3) (9=3), gen(rr2)
recode V001510 (8=3) (9=3), gen(rr3)
recode V001511 (8=3) (9=3), gen(rr4)
pwcorr rr1 rr2 rr3 rr4
**a=.68
alpha rr1 rr2 rr3 rr4, gen(resentsc)

recode V001420 (1=1) (2=-1) (8/9=0), gen(lessgov1)
recode V001421 (2=1) (1=-1) (8/9=0), gen(lessgov2)
recode V001422 (1=1) (2=-1) (8/9=0), gen(lessgov3)
pwcorr lessgov1 lessgov2 lessgov3
**a=.74
alpha lessgov1 lessgov2 lessgov3, gen(lessgovsc)

recode V001521 (1=5) (2=4) (4=2) (5=1) (8/9=3), gen(equal1)
recode V001522 (8=3) (9=3), gen(equal2)
recode V001523 (1=5) (2=4) (4=2) (5=1) (8/9=3), gen(equal3)
recode V001524 (8=3) (9=3), gen(equal4)
recode V001525 (8=3) (9=3), gen(equal5)
recode V001526 (1=5) (2=4) (4=2) (5=1) (8/9=3), gen(equal6)
pwcorr equal1 equal2 equal3 equal4 equal5 equal6
**a=.91
alpha equal1 equal2 equal3 equal4 equal5 equal6, gen(equalsc)
recode V000080 (1=1) (2/4=0) (5=1) (6/11=0) (12/13=1) (14/36=0) (37=1) (38/46=0) (47/48=1) (49/50=0) (51=1) (52=0) (53=1) (54/99=0), gen(deepsouth)

regress presapp whiteid resentsc lessgovsc equalsc repid conid  retroecon prospecon income age educ deepsouth churattend female [aweight=V000002] if white==1, cluster(V000082)
regress presapp whiteid [aweight=V000002] if white==1, cluster(V000082)

*2008 
use "C:\Users\gpetrow\Dropbox\Research\White id vote choice\data\cces 2008 whid vc paper.dta", clear

recode cc302 (1=5) (2=4) (4=2) (5=1) (6/99=3), gen(retroecon)
recode cc304a (1=3) (3=1), gen (prospecon1)
recode cc304b (1=3) (3=1), gen (prospecon2)
corr prospecon1 prospecon2
**a=.84
alpha prospecon1 prospecon2, gen(prospeconsc)
recode dff3112 (1=4) (2=3) (3=2) (4=1) (5/99=.), gen(whid3)
recode demid (1=7) (2=6) (3=5) (5=3) (6=2) (7=1), gen(repid)
recode libid (1=5) (2=4) (4=2) (5=1), gen (conid)
recode cc304 1=1 2=0 3=0 4=0 5=0 8=0 9=0, gen (iraqbad)
recode dff396 1=5 2=4 8=3 3=2 4=1, gen (rr1)
recode dff3102 1=5 2=4 8=3 3=2 4=1, gen (rr2)
recode dff3100 4=5 3=4 5=3 8=3 2=2 1=1 9=., gen (rr3)
recode dff3101 4=5 3=4 5=3 8=3 2=2 1=1 9=., gen (rr4)
recode dff395 1=5 2=4 5=3 8=3 3=2 4=1 9=., gen (rr5)
recode dff3118b 1=5 2=4 5=3 8=3 3=2 4=1 9=., gen (rr5v2)
recode dff3119b 4=5 3=4 5=3 8=3 2=2 1=1 9=., gen (rr3v2)
recode dff3120b 1=5 2=4 5=3 8=3 3=2 4=1 9=., gen (rr4v2)
alpha rr1 rr2 rr3 rr4 rr5, gen(resentsc)
recode cc422 1=1 2/3=0, gen (procarbtax)
recode v208 2=1 1=0, gen (female)
recode v213 8=. 9=., gen (educ)
recode v217 6=1 5=2 4=3 3=4 2=5 1=6 7=1 8=1, gen (churchattend)
gen age = 2008-v207
recode v246 1=1 2=2 3=3 4=4 5=5 6=6 7=7 8=8 9=9 10=10 15=., gen (faminc)
recode v251b (1=1) (12/13=1) (22=1) (28=1) (45=1) (48=1) (2/11=0) (14/21=0) (23/27=0) (29/44=0) (46/47=0) (49/99=0), gen (deepsouth)
**impute family income
recode v246 1=1 2=2 3=3 4=4 5=5 6=6 7=7 8=8 9=9 10=10 15=., gen (faminc)
tab faminc
regress faminc  female unemployed black married educ milfam unionmem homeown churchattend bushdisapp obamavote age 
*then solve for the missing values using the coefficients from the regression
recode cc335bus (1=5) (2=4) (4=2) (5=1) (6/99=3), gen(bushapp2)

regress bushapp whid3 resentsc iraqbad retroecon prospeconsc repid conid female educ churchattend age famincimp deepsouth [aweight=v201], cluster(v264)

*2010 
use "2010anes.dta", clear
**resent c1_zh1 c1_zh2 c1_zh3 c1_zh4
corr c1_zh1 c1_zh2 c1_zh3 c1_zh4
**a=.82
alpha c1_zh1 c1_zh2 c1_zh3 c1_zh4, gen(resent)
**obamaapprove
recode c1_y1 (1=1) (3=0) (2=-1), gen(obamaapprove)
**derecon1 no recode
**ideol c1_pp_11 no recode
**whiteid c1_q1 no recode
**deepsouth c1_state
*deep south states:  GA (58), AL (63), SC (57), MS (64) and LA (72)
**add FL (59) , TX (74)
recode c1_state (1/56=0) (57/59=1) (60/62=0) (63/64=1) (65/71=0) (72=1) (73=0) (74=1) (75/999=0), gen(deepsouth2) 
tab deepsouth
tab deepsouth2
**partyid 
**see anes 2010 var merges.xlsx
recode c1_ppp_8 (1=6) (2=5) (.=0) (-2=0) if c1_ppp_7==1, gen(reps)
recode c1_ppp_9 (1=0) (2=1) (.=0) (-2=0) if c1_ppp_7==2, gen(dems)
recode c1_pp_10 (-2=0) (1=4) (2=2) (-1=3) (.=0) if c1_ppp_7==3 | 5, gen(leaners)
**stim 
**see anes 2010 var merges.xlsx
recode c1_n1 (3=3) (1/2=0) (-7=3) (-6/-5=.), gen (stimq1)
recode c1_n2 (1=0) (2=1) (3=2) (-6=.) (-1=0) (-5=.), gen(stimgood)
recode c1_n3 (1=6) (2=5) (3=4) (-7=0) (-6=.) (-1=0) (-5=.), gen(stimbad)
**rollcall ; 
gen rollcall = c1_l1+c1_l2+c1_l3+c1_l4+c1_l6+c1_l7+c1_l8+c1_l9
recode c1_ppmar (1=1) (2/99=0) (.=-9999), gen (married)
recode c1_ppren  (1=1) (2/99=0) (.=-9999), gen (ownhome)
recode c1_p_121   (1=1) (-1=0) (2/99=0) (.=-9999), gen (unionmem)
recode c1_p_129 (6=1) (5=2) (4=3) (3=4) (2=5) (1=6) (7/9999=-9999) (-2=-9999) (-1=-9999), gen (religattend)
regress obamaapprove whiteid resent rollcall stim derecon1 ideol partyid c1_ppinc c1_ppage c1_ppgen c1_ppe_1 ownhome married unionmem deepsouth religattend, cluster (c1_xcd)
regress obamaapprove c1_q1 resent rollcall stim derecon1 c1_pp_11 partyid c1_ppinc c1_ppage c1_ppgen c1_ppe_1 ownhome married unionmem deepsouth religattend, cluster (c1_xcd)
margins, at (whiteid==1)
margins, at (whiteid==2)
margins, at (whiteid==3)
margins, at (whiteid==4)
margins, at (whiteid==5)
regress obamaapprove c1_q1 [pweight=c1_sampw], cluster (c1_xcd)

*2012 
use "2012anes.dta", clear
recode libcpre_self (1=1) (2=2) (3=3) (4=4) (5=5) (6=6) (7=7) (-2=4) (-8=4) (-9=4), gen(conid7pt)
recode pid_x (1=1) (2=2) (3=3) (4=4) (5=5) (6=6) (7=7) (-2=.), gen(repid7pt)
recode dem_marital (1=1) (2=1) (3=0) (4=0) (5=0) (6=0) (-9=0), gen(married)
recode dem_edugroup (1=1) (2=2) (3=3) (4=4) (5=5) (-2=.) (-9=.), gen(educ)
recode gender_respondent (1=1) (2=2) (-1=.), gen(female)
recode ident_whiteid (1=5) (2=4) (3=3) (4=2) (5=1) (-1=.) (-2=.) (-6=.) (-7=.) (-9=.), gen(whiteid)
recode health_2010hcr (1=1) (3=2) (2=3) (-8=2) (-9=2), gen(healthcareopp)
recode relig_churchoft (1=5) (2=4) (3=3) (4=2) (5=1) (-1=.) (-9=3), gen(churchattend)
recode sample_stfips (1=1) (2=0) (4=0) (5=0) (6=0) (8=0) (9=0) (10=0) (11=0) (12=1) (13=1) (15=0) (16=0) (17=0) (18=0) (19=0) (20=0) (21=0) (22=1) (23=0) (24=0) (25=0) (26=0) (27=0) (28=1) (29=0) (30=0) (31=0) (32=0) (33=0) (34=0) (35=0) (36=0) (37=0) (38=0) (39=0) (40=0) (41=0) (42=0) (44=0) (45=1) (46=0) (47=0) (48=1) (49=0) (50=0) (51=0) (53=0) (54=0) (55=0) (56=0), gen(deepsouth)
recode dem_raceeth (1=1) (2=0) (3=0) (4=0) (-8=0) (-9=0), gen(white)
recode resent_workway (1=5) (2=4) (3=3) (4=2) (5=1) (-6=.) (-7=.) (-8=3) (-9=3), gen(blacksnofavors)
recode resent_slavery (1=1) (2=2) (3=3) (4=4) (5=5) (-6=.) (-7=.) (-8=3) (-9=3), gen(pastslaverynohrd)
recode resent_deserve (1=1) (2=2) (3=3) (4=4) (5=5) (-6=.) (-7=.) (-8=3) (-9=3) (-1=.), gen(blknotlessdeserve)
recode resent_try (1=1) (2=2) (3=3) (4=4)(5=5) (-6=.) (-7=.) (-8=3) (-9=3), gen(blktryhrd)
alpha blacksnofavors blknotlessdeserve pastslaverynohrd blktryhrd, gen(resentsc)
recode mode (1=1) (2=0), gen(ftf)
recode econ_ecnow (1=5) (2=4) (4=2) (5=1) (-8=3) (-9=.), gen (econcurrgood)
recode econ_ecpast_x (1=5) (2=4) (4=2) (5=1) (-8=3) (-9=.), gen (econpastyrbtr)
recode econ_ecnext_x (1=5) (2=4) (4=2) (5=1) (-8=3) (-9=.), gen (econnxtyrbtr)
recode egal_equal (1=5) (2=4) (4=2) (5=1) (-6/-7=.) (-8=3) (-9=3), gen (egal1)
recode egal_toofar (-6/-7=.) (-8=3) (-9=3), gen (egal2)
recode egal_bigprob  (1=5) (2=4) (4=2) (5=1) (-6/-7=.) (-8=3) (-9=3), gen (egal3)
recode egal_worryless  (-6/-7=.) (-8=3) (-9=3), gen (egal4)
recode egal_notbigprob  (-6/-7=.) (-8=3) (-9=3), gen (egal5)
recode egal_fewerprobs  (1=5) (2=4) (4=2) (5=1) (-6/-7=.) (-8=3) (-9=3), gen (egal6)
corr egal1 egal2 egal3 egal4 egal5 egal6
**a=.98
alpha egal1 egal2 egal3 egal4 egal5 egal6, gen(egalitsc)
recode govrole_big (1=1) (2=0) (-6=.) (-7=.) (-8=0) (-9=0), gen (limitgov1)
recode govrole_market (2=1) (1=0)  (-6=.) (-7=.) (-8=0) (-9=0), gen (limitgov2)
recode govrole_lessmore  (1=1) (2=0) (-6=.) (-7=.) (-8=0) (-9=0), gen (limitgov3)
corr limitgov1 limitgov2 limitgov3
**a=.77
alpha limitgov1 limitgov2 limitgov3, gen (limitgovsc)
recode dem_agegrp_iwdate (15=.), gen(age)
recode incgroup_prepost (-6=.) (-8=13) (-9=13), gen(income)
recode presapp_job_x (5=1) (4=2) (2=4) (1=5) (-8=3) (-9=.), gen(obamaapp)

regress obamaapp whiteid egalitsc limitgovsc econcurrgood econpastyrbtr econnxtyrbtr resentsc healthcareopp educ female ftf age income churchattend deepsouth conid7pt repid7pt if white==1 [iweight=weight_full], cluster (sample_district)
regress obamaapp whiteid if white==1 [aweight=weight_full], cluster (sample_district)

*Table 5: Indirect Paths of White Racial Identity among Whites and White Candidate Preference for the U.S. Congress in 2010 and U.S. Congress Vote Choice in 2012, Structural Equation Models
**I used MPlus, and then used its coefficients in Stata to estimate the predicted scores
*House SEM 2010
* 7 July 2016 House vote 2010 errors not correlated.inp.txt
*Figure E4
sem (obamaap <- whiteid@-.12 resent rollcall stim derecon1 ideol partyid c1_ppinc c1_ppage c1_ppgen c1_ppe_1 churattend deepsouth) (demhousevote2par<-obamaap@.04 ideol partyid derecon1 stim c1_ppinc c1_ppgen c1_ppe_1 c1_ppage churattend deepsouth) [pweight=c1_sampw], vce(cl c1_state) cov(e.obamaap*e.demhousevote2par) 
predict predapprove if whiteid==1, xb(obamaap)
predict predapprove2 if whiteid==2, xb(obamaap)
predict predapprove3 if whiteid==3, xb(obamaap)
predict predapprove4 if whiteid==4, xb(obamaap)
predict predapprove5 if whiteid==5, xb(obamaap)

predict pdemhsevote if whiteid==1, xb(demhousevote2par)
predict pdemhsevote2 if whiteid==2, xb(demhousevote2par)
predict pdemhsevote3 if whiteid==3, xb(demhousevote2par)
predict pdemhsevote4 if whiteid==4, xb(demhousevote2par)
predict pdemhsevote5 if whiteid==5, xb(demhousevote2par)

*Senate SEM 2010
*6 July 2016 Senate vote 2010 errors correlted.inp.txt
*Figure E4
sem (obamaap <- whiteid@-.12 resent rollcall stim derecon1 ideol partyid c1_ppinc c1_ppage c1_ppgen c1_ppe_1 deepsouth churattend) (demsenvote2par<-obamaap@.33 ideol partyid derecon1 c1_ppinc c1_ppgen c1_ppe_1 c1_ppage churattend) [pweight=c1_sampw], vce(cl c1_xcd) cov(e.obamaap*e.demsenvote2par) 
predict pdemsenvote if whiteid==1, xb(demsenvote2par)
predict pdemsenvote2 if whiteid==2, xb(demsenvote2par)
predict pdemsenvote3 if whiteid==3, xb(demsenvote2par)
predict pdemsenvote4 if whiteid==4, xb(demsenvote2par)
predict pdemsenvote5 if whiteid==5, xb(demsenvote2par)

*House SEM 2012
*10 July 10 House 2016 this works
*Figure E5
sem (obamaapp <- whiteid@-.04 resentsc egalitsc limitgovsc econcurrgood econpastyrbtr econnxtyrbtr healthcareopp educ female ftf age income churchattend deepsouth conid7pt repid7pt) (demhousevote2par<- obamaapp@1.0 egalitsc limitgovsc econcurrgood econpastyrbtr econnxtyrbtr educ female ftf age income churchattend deepsouth conid7pt repid7pt) [iweight=weight_full], vce(cl sample_state) cov(e.obamaapp*e.demhousevote2par)
predict predapprove if whiteid==1, xb(obamaapp)
predict predapprove2 if whiteid==2, xb(obamaapp)
predict predapprove3 if whiteid==3, xb(obamaapp)
predict predapprove4 if whiteid==4, xb(obamaapp)
predict predapprove5 if whiteid==5, xb(obamaapp)

predict pdemhsevote if whiteid==1, xb(demhousevote2par)
predict pdemhsevote2 if whiteid==2, xb(demhousevote2par)
predict pdemhsevote3 if whiteid==3, xb(demhousevote2par)
predict pdemhsevote4 if whiteid==4, xb(demhousevote2par)
predict pdemhsevote5 if whiteid==5, xb(demhousevote2par)

*Senate SEM 2012
*7 July 2016 Senate vote 2012 errors correlted.inp.txt
*Figure E5
sem (obamaapp <- whiteid@-.05 resentsc egalitsc limitgovsc econcurrgood econpastyrbtr econnxtyrbtr healthcareopp educ female ftf age income churchattend deepsouth conid7pt repid7pt) (demsenvote2par<- obamaapp@.51 egalitsc limitgovsc educ female ftf age income churchattend deepsouth conid7pt repid7pt) [iweight=weight_full], vce(cl sample_district) cov(e.obamaapp*e.demsenvote2par)
predict predapproves if whiteid==1, xb(obamaapp)
predict predapproves2 if whiteid==2, xb(obamaapp)
predict predapproves3 if whiteid==3, xb(obamaapp)
predict predapproves4 if whiteid==4, xb(obamaapp)
predict predapproves5 if whiteid==5, xb(obamaapp)

predict pdemsenvote if whiteid==1, xb(demsenvote2par)
predict pdemsenvote2 if whiteid==2, xb(demsenvote2par)
predict pdemsenvote3 if whiteid==3, xb(demsenvote2par)
predict pdemsenvote4 if whiteid==4, xb(demsenvote2par)
predict pdemsenvote5 if whiteid==5, xb(demsenvote2par)

*Table B1: American National Election Study 2012 Bivariate Regression Coefficients between White Identity and Other Constructs
use "2012anes.dta", clear
regress blackft whiteid if white==1 [aweight=weight_full], cluster (sample_district)
regress whiteft whiteid if white==1 [aweight=weight_full], cluster (sample_district)
regress hispft whiteid if white==1 [aweight=weight_full], cluster (sample_district)
oprobit blksymp whiteid if white==1 [iweight=weight_full], cluster (sample_district)
oprobit blkadmir whiteid if white==1 [iweight=weight_full], cluster (sample_district)
oprobit linkwhite whiteid if white==1 [iweight=weight_full], cluster (sample_district)
oprobit obamafavblacks whiteid if white==1 [iweight=weight_full], cluster (sample_district)
logit obamamuslim whiteid if white==1 [iweight=weight_full], cluster (sample_district)
regress resentsc whiteid if white==1 [aweight=weight_full], cluster (sample_district)
regress stereosc2 whiteid if white==1 [aweight=weight_full], cluster (sample_district)

*Table B2: Cooperative Congressional Election Study 2008 Bivariate Regression Coefficients between White Identity and Other Constructs
logit mcangry whid3  [iweight=v201], cluster(v250)
oprobit racediscr whid3  [aweight=v201], cluster(v250)
oprobit whproud whid3  [aweight=v201], cluster(v250)
oprobit blckangry whid3  [aweight=v201], cluster(v250)
regress mccainft whid3 [aweight=v201], cluster(v250)
regress obamaftdiff whid3 [aweight=v201], cluster(v250)
oprobit whtinfl whid3 [aweight=v201], cluster(v250)
oprobit blkinfl whid3 [aweight=v201], cluster(v250)
regress resentsc whid3 [aweight=v201], cluster(v250)
regress blckangrydiff whid3 [aweight=v201], cluster(v250)
logit blkstoofast whid3  [iweight=v201], cluster(v250)
probit blktension whid3 [aweight=v201], cluster(v250)

*Table D1.  President Obama Vote Choice and Approval Models, controlling for white black stereotype evaluations
use "2012anes.dta", clear
alpha whitelazy whiteunintell, gen(whitenegstereosc)
**a=.44
alpha whtlazy whtunintell, gen (whitenegst2)
**a=.78
alpha blacklazy blackunintell, gen(blacknegstereosc)
**a=.58
alpha blklazy blkunintell, gen(blacknegst2)
gen stereodiffsc = blacknegstereosc-whitenegstereosc
gen stereodiffsc2 = blacknegst2-whitenegst2
logit obama2party whiteid stereodiffsc2 resentsc healthcareopp egalitsc limitgovsc econpastyrbtr econnxtyrbtr educ female ftf age income churchattend deepsouth conid7pt repid7pt if white==1 [iweight=weight_full], cluster (sample_district)
oprobit obamaapp whiteid stereodiffsc2 resentsc egalitsc limitgovsc econcurrgood econpastyrbtr econnxtyrbtr healthcareopp educ female ftf age income churchattend deepsouth conid7pt repid7pt if white==1 [iweight=weight_full], cluster (sample_district)
regress obamaapp whiteid stereodiffsc2 resentsc egalitsc limitgovsc econcurrgood econpastyrbtr econnxtyrbtr healthcareopp educ female ftf age income churchattend deepsouth conid7pt repid7pt if white==1 [iweight=weight_full], cluster (sample_district)
